#define DEBUG
#include <cstdio>
#include <cstdlib>
#include <ctime>
#include <algorithm>

using namespace std;

void makeData(int maxn, int maxa) {
  FILE *f = fopen("rhombus.in", "w");
  int n=rand()%(maxn-2)+3, m=rand()%(maxn-2)+3, h=rand()%min(m/2, n/2)+1;
  fprintf(f, "%d %d %d 0\n", n, m, h);
  for (int i=1; i<=n; i++) {
    for (int j=1; j<=m; j++) {
      fprintf(f, "%d ", (rand()%2 ? -1 : 1)*rand()%maxa);
    }
    fprintf(f, "\n");
  }
  fclose(f);
}

int main() {
  srand(time(NULL));
  int times, n, a;
  scanf("%d %d %d", &times, &n, &a);
  for (int i=1; i<=times; i++) {
    makeData(n, a);
    if (system("./src")) {
      printf("RE\n");
      return -1;
    } else if (system("./checker")) {
      printf("CE\n");
      return -1;
    } else if (system("cmp rhombus.out rhombus.ans")) {
      printf("WA\n");
      return -1;
    }
  }
  return 0;
}
